﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.SqlClient;
using Kunlun.Models;
using Kunlun.ViewModels;

namespace Kunlun.BusinessLogic
{
    public partial class KunlunProductPic
    {

        public static List<Product_pic> GetProductPicList(string pid)
        {
            using (KunLunEntities db = new KunLunEntities())
            {
                if (!string.IsNullOrEmpty(pid))
                {
                    return db.Product_pic.Where(m => m.ProductID == pid && m.IsVisible == true).OrderBy(m=>m.Sort).ToList();
                }
                return new List<Product_pic>();
            }
        }
    }
}
